1

Let’s re-estimate our model from the previous exercise, just with another dependent variable. Again, consult the GESIS Panel codebook and choose another variable that may make sense to be inserted into a regression.

If you’re again struggeling, what about one of the dependent variables from the original exercises:

  1. hzcy005a
  2. hzcy026a
  3. hzcy072a
Be aware that you may have to conduct some recoding.

2

Re-run your analysis just by switching the dependent variables.

3

Now extract the prediction data for your main independent variable for this model.
You may want to use the function get_model_data() from the sjPlot package. You should set the option type = "pred" and define in the terms option your independent variable.

4

Repeat the previous step for your original model and combine both datasets. The resulting data should be a data.frame or a tibble.
  • For the combination, you simply have append both datasets rowwise. You can either use the bind_rows() function from the dplyr package or rbind() from base R.
  • Make sure that you add an indicator variable for the model for each of the datasets before or while the combination.
  • You can convert any (well, a lot of…) data object to a tibble using as_tibble() from the tibble package.

5

Create a simple faceted (using facet_wrap()) ggplot with the regression predictions.
  • For the combination, you simply have append both datasets rowwise. You can either use the bind_rows() function from the dplyr package or rbind() from base R.
  • Make sure that you add an indicator variable for the model for each of the datasets before or while the combination.
  • You can convert any (well, a lot of…) data object to a tibble using as_tibble() from the tibble package.